<?php 
session_start();
if($_GET ['do'] == ''){echo 'Ошибка:435'; exit;} else {$do = htmlspecialchars($_GET ['do']);}
if($_GET ['fr'] == ''){echo 'Ошибка:583'; exit;} else {$fr = htmlspecialchars($_GET ['fr']);}
if($_SESSION['logmit']=='' or !isset($_SESSION['logmit'])){echo "Ошибка: 373"; exit;}
$log = $_SESSION['logmit'];
include('/config/config.php');
$put = $pdir.$log."/friends.php";
if(file_exists($put)){include($put);
$fr = '<li><font size="1">[ <a href="/delfr" rel="'.$fr.'&do=%LOGIN%" id="frdel">Удалить</a> ]</font> <a href="/?prof='.$fr.'">'.$fr.'</a></li>';
//if (preg_match("/".$fr."/i",$friends)==false){echo "OUT"; exit;}
$friends = str_replace($fr,'',$friends);
$msg = '
<?php 
$friends = \''.$friends.'\';
?>';
$fs=fopen($put, 'w');
fwrite($fs, $msg);
fclose($fs);
echo "Удален";
exit;
}
echo "Ошибка";
?>